package org.example.common.core.utils.tanent;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * 获取租户信息
 */
public class TenantContextHolder {

    private static final ThreadLocal<String> THREAD_LOCAL = new TransmittableThreadLocal<>();

    public static void set(String tenantId) {
        THREAD_LOCAL.set(tenantId);
    }

    public static String getTenantId() {
        return THREAD_LOCAL.get();
    }

    public static void remove() {
        THREAD_LOCAL.remove();
    }

}
